package com.zifeng.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Date;
import java.util.Objects;

/**
 * 船舶用户对象 user
 *
 * @author zifeng
 * @date 2025-03-27
 */
@Data
public class User {
    private static final long serialVersionUID = 1L;

    /**
     * $column.columnComment
     */
    private Long id;


    private String loginUsername;


    private String password;


    private String username;

    private long money;

    private String phone;


    private String email;

    private String company;

    private int age;

    private String sex;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createAt;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateAt;

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("loginUsername", getLoginUsername())
                .append("password", getPassword())
                .append("username", getUsername())
                .append("age", getAge())
                .append("sex", getSex())
                .append("money", getMoney())
                .append("phone", getPhone())
                .append("email", getEmail())
                .append("company", getCompany())
                .append("createAt", getCreateAt())
                .append("updateAt", getUpdateAt())
                .toString();
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        User user = (User) o;
        return Objects.equals(id, user.id);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id);
    }
}
